package io.wit.modules.sys.entity;

import io.wit.common.validator.group.AddGroup;
import io.wit.common.validator.group.UpdateGroup;
import org.hibernate.validator.constraints.Email;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

/**
 * 系统用户
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2016年9月18日 上午9:28:55
*/
public class SysUserEntity implements Serializable {

    private static final long serialVersionUID = 1L;
	
	/**
	 * 用户ID
	*/
	private Long userId;

    /**
     * 员工id(为空时是系统账号1标识,否则是员工账号2标识),用于区分员工角色和系统角色,仅在登录时有用
    */
	private Integer userType;

	private Integer options;//是否是代理或管理部门

	/**
	 * 经营主体Id
	*/
	private Long subjectId;

	private String subjectName;

	private Long employeeId;

    private String areaJson;

    private String areaIds,areaNames;

    public String getAreaJson(){
        return areaJson;
    }

    public void setAreaJson(String areaJson){
        this.areaJson = areaJson;
    }

    public String getAreaIds(){
        return areaIds;
    }

    public void setAreaIds(String areaIds){
        this.areaIds = areaIds;
    }

    public String getAreaNames(){
        return areaNames;
    }

    public void setAreaNames(String areaNames){
        this.areaNames = areaNames;
    }

    public Integer getOptions(){
        return options;
    }

    public void setOptions(Integer options){
        this.options = options;
    }

    /**
	 * 用户名
	*/
	@NotBlank(message="用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private String username;

	/**
	 * 密码
	*/
	@NotBlank(message="密码不能为空", groups = AddGroup.class)
	private String password;

	/**
	 * 角色名称
	*/
	private String roleName;

	/**
	 * 盐
	*/
	private String salt;

	/**
	 * 邮箱
	*/
	@Email(message="邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
	private String email;

	/**
	 * 手机号
	*/
	private String mobile;

	/**
	 * 状态  0：禁用   1：正常
	*/
	private Integer status;
	
	/**
	 * 角色ID列表
	*/
    @NotNull(message="角色不能为空", groups = {AddGroup.class, UpdateGroup.class})
	private Long roleId;

	/**
	 * 创建时间
	*/
	private Date createTime;

	/**
	 * 部门ID
	*/
	private Long deptId;

	/**
	 * 部门名称
	*/
	private String deptName;

	//0：PC用户，1经营主体，2：普通员工
	private Integer type;

	/**
	 * 设置：
	 * @param userId 
	*/
	public void setUserId(Long userId) {
		this.userId = userId;
	}

	/**
	 * 获取：
	 * @return Long
	*/
	public Long getUserId() {
		return userId;
	}
	
	/**
	 * 设置：用户名
	 * @param username 用户名
	*/
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * 获取：用户名
	 * @return String
	*/
	public String getUsername() {
		return username;
	}
	
	/**
	 * 设置：密码
	 * @param password 密码
	*/
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * 获取：密码
	 * @return String
	*/
	public String getPassword() {
		return password;
	}
	
	/**
	 * 设置：邮箱
	 * @param email 邮箱
	*/
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 * 获取：邮箱
	 * @return String
	*/
	public String getEmail() {
		return email;
	}
	
	/**
	 * 设置：手机号
	 * @param mobile 手机号
	*/
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	/**
	 * 获取：手机号
	 * @return String
	*/
	public String getMobile() {
		return mobile;
	}
	
	/**
	 * 设置：状态  0：禁用   1：正常
	 * @param status 状态  0：禁用   1：正常
	*/
	public void setStatus(Integer status) {
		this.status = status;
	}

	/**
	 * 获取：状态  0：禁用   1：正常
	 * @return Integer
	*/
	public Integer getStatus() {
		return status;
	}
	
	/**
	 * 设置：创建时间
	 * @param createTime 创建时间
	*/
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**
	 * 获取：创建时间
	 * @return Date
	*/
	public Date getCreateTime() {
		return createTime;
	}

	public Long getRoleId() {
		return roleId;
	}

	public void setRoleId(Long roleId) {
		this.roleId = roleId;
	}

	public String getSalt() {
		return salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	public String getDeptName() {
		return deptName;
	}

	public void setDeptName(String deptName) {
		this.deptName = deptName;
	}

	public Integer getType() {
		return type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	public String getRoleName() {
		return roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	public Long getSubjectId() {
		return subjectId;
	}

	public void setSubjectId(Long subjectId) {
		this.subjectId = subjectId;
	}

    public Long getEmployeeId(){
        return employeeId;
    }

    public void setEmployeeId(Long employeeId){
        this.employeeId = employeeId;
    }

    public String getSubjectName(){
        return subjectName;
    }

    public void setSubjectName(String subjectName){
        this.subjectName = subjectName;
    }

    public Integer getUserType(){
        return userType;
    }

    public void setUserType(Integer userType){
        this.userType = userType;
    }
}